//
//  UIViewController+WYAlertController.m
//  Boss
//
//  Created by admin on 2018/6/12.
//  Copyright © 2018年 admin. All rights reserved.
//

#import "UIViewController+WYAlertController.h"
@implementation UIViewController (WYAlertController)
-(void)showAlertControllerWithTitle:(NSString *)title WithMessage:(NSString *)message WithActionSheet:(NSArray *)sheetTitle WithSelect:(NSUInteger )select
{
    UIAlertController * alertController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:(UIAlertControllerStyleActionSheet)];
    
    for (int i = 0; i<sheetTitle.count; i++) {
        UIAlertAction *action = [UIAlertAction actionWithTitle:sheetTitle[i] style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
            
        }];
         [alertController addAction:action];
        if (i==select) {
            [action setValue:kColorMainColor forKey:@"_titleTextColor"];
        }
    }
    
    
    
    
    [self presentViewController:alertController animated:YES completion:nil];
}
@end
